/**
 * Created by zd 20161230
 */

 export const FETCH_INDEX_DATA = 'FETCH_INDEX_DATA';
 export const FETCH_MALL_THEM_HOS = 'FETCH_MALL_THEM_HOS';
 export const FETCH_MALL_THEM_HOS_DET = 'FETCH_MALL_THEM_HOS_DET';
 export const FETCH_MALL_THEM_DOC = 'FETCH_MALL_THEM_DOC';
 export const FETCH_MALL_THEM_DOC_DET = 'FETCH_MALL_THEM_DOC_DET';
 export const FETCH_MALL_THEM_HOS_SERVITEM = 'FETCH_MALL_THEM_HOS_SERVITEM';
 export const FETCH_MALL_THEM_HOS_SERVITEM_DET = 'FETCH_MALL_THEM_HOS_SERVITEM_DET';
 export const FETCH_MALL_THEM_ANLI = 'FETCH_MALL_THEM_ANLI';
 export const FETCH_MALL_THEM_DOC_SHOW = 'FETCH_MALL_THEM_DOC_SHOW';
 export const USER_SHOP_LIST = 'USER_SHOP_LIST';
 export const ITEM_PRO = 'ITEM_PRO';
 export const CHECKED_ARR = 'CHECKED_ARR';
 export const GET_ORDER_CLASSIFY = 'GET_ORDER_CLASSIFY';
 export const GET_ORDER_CLASSIFY_MORE = 'GET_ORDER_CLASSIFY_MORE';
 export const NEWS_CMS_CLASS_LIST = 'NEWS_CMS_CLASS_LIST';
 export const NEWS_CMS_ART_LIST = 'NEWS_CMS_ART_LIST';
 export const ITEMCLASS_SHOW = 'ITEMCLASS_SHOW';
 export const GET_ORDER_DETAIL = 'GET_ORDER_DETAIL';

 export const START_LOADING = 'START_LOADING';
 export const FINISH_LOADING = 'FINISH_LOADING';
 export const FETCH_COMING_SOON_FAIL='FETCH_COMING_SOON_FAIL';
 export const POST_TEST_MSG='POST_TEST_MSG';
 export const USER_LOGINED='USER_LOGINED';

import {hashHistory } from 'react-router'

// let testApiUrl = 'http://image.meirenguvip.com/'
let testApiUrl = 'https://img.meirenguvip.com/'

export const getHosImg = function(imgO,size,id){
   var img = imgO,
       img_point = img.indexOf('.'),
       img_src = testApiUrl + "hospital/" + id + "/" + img.substring(0,img_point) + size + img.substring(img_point);
   return img_src;
 };
export const getDocImg = function(imgO,size,hosId,docId){
   var img = !!imgO?imgO:'',
       img_point = img?img.indexOf('.'):'',
       img_src = testApiUrl+"hospital/" + hosId + "/doctor/" + docId + '/' + img.substring(0,img_point) + size + img.substring(img_point);
   return img_src;
 };
 export const getServImg = function(imgO,size,hosId,itemId){
    var img = imgO,
        img_point = img.indexOf('.'),
        img_src = testApiUrl +"hospital/" + hosId + "/item/" + itemId + '/' + img.substring(0,img_point) + size + img.substring(img_point);
    return img_src;
  };
  export const getCaseImg = function(imgO,size,hosId,itemId){
     var img = imgO,
         img_point = img.indexOf('.'),
         img_src = testApiUrl +"case/" + hosId + "/" + itemId + "/"  + img.substring(0,img_point) + size + img.substring(img_point);
     return img_src;
   };
   export const getArtImg = function(imgO,size){
      var img = imgO,
          img_point = img.indexOf('.'),
          img_src = testApiUrl +"article/" + img.substring(0,img_point) + size + img.substring(img_point);
      return img_src;
    };

export const BindMixin ={
  no_login:function(a){
    if(a){
      alert('您还未登录 请先登录')
      hashHistory.push('/userView/user');
      return false;
    }
  }
}

export const addMd5 = function(){
  alert(0)
}
